<#macro select code name value attr style>
	<input type="hidden" name="${name!''}.text" id="${name!''}_text"/>
	<select id="${(name!'')?replace('.' , '_')}" name="${name!''}" ${attr} <#if style?? && style !=''>style="${style}"</#if> onChange="$('#${name!''}_text').val($(this).find('option:selected').val())">
		<option value="">请选择...</option>
		<#list uKeFuDic[code] as macroSysDic>
		<option value="<#if macroSysDic.discode>${macroSysDic.code}<#else>${macroSysDic.id}</#if>" <#if value?? && macroSysDic?? && (macroSysDic.id == value || macroSysDic.code == value)>selected="selected"</#if>>${macroSysDic.name!''}</option>
		</#list>
	</select>
</#macro>

<#macro select2 code name value attr style defaultname>
	<select lay-filter="${(name!'')?replace('.' , '_')}" id="${(name!'')?replace('.' , '_')}" name="${name!''}" ${attr} <#if style?? && style !=''>style="${style}"</#if> onChange="$('#${name!''}_text').val($(this).find('option:selected').text())">
		<option value="">${defaultname!'请选择...'}</option>
		<#list uKeFuDic[code] as macroSysDic>
		<option value="<#if macroSysDic.discode>${macroSysDic.code}<#else>${macroSysDic.id}</#if>" <#if value?? && macroSysDic?? && (macroSysDic.id == value || macroSysDic.code == value)>selected="selected"</#if>>${macroSysDic.name!''}</option>
		</#list>
	</select>
</#macro>

<#macro subselect macroSysDicList name value attr style>
	<input type="hidden" name="${name!''}.text" id="${name!''}_text"/>
	<select lay-filter="${(name!'')?replace('.' , '_')}"  id="${(name!'')?replace('.' , '_')}" name="${name!''}" ${attr} style="${style}" onChange="$('#${name!''}_text').val($(this).find('option:selected').val())">
		<option value="">请选择...</option>
		<#if macroSysDicList??>
		<#list macroSysDicList as macroSysDic>
		<option value="<#if macroSysDic.discode>${macroSysDic.code}<#else>${macroSysDic.id}</#if>" <#if value?? && macroSysDic?? && (macroSysDic.id == value || macroSysDic.code == value)>selected="selected"</#if>>${macroSysDic.name!''}</option>
		</#list>
		</#if>
	</select>
</#macro>

<#macro radio code name value style>
	<#list uKeFuDic[code] as macroSysDic>
		<input type="radio" name="${name}" value="${macroSysDic.name!''}" title="${macroSysDic.name!''}"<#if macroSysDic.name?? && ( macroSysDic.id == value || macroSysDic.name == value || macroSysDic.code == value)>checked="checked"</#if>>
	</#list>
</#macro>

<#macro salescheckbox code name value style>
	<#list uKeFuDic[code] as macroSysDic>
		<input type="checkbox" name="${name}" lay-skin="primary" value="${macroSysDic.name!''}" title="${macroSysDic.name!''}"<#if macroSysDic.name??&& value?? && value != '' && ( value?index_of(macroSysDic.id) gte 0 || value?index_of(macroSysDic.name) gte 0 || value?index_of(macroSysDic.code) gte 0)>checked="checked"</#if>>
	</#list>
</#macro>

<#macro checkbox sysDicList name value style>
	<#list sysDicList as macroSysDic>
		<input type="checkbox" name="${name}" value="${macroSysDic.id!''}" title="${macroSysDic.name!''}"<#if macroSysDic.id == value>checked="checked"</#if>>
	</#list>
</#macro>
